﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTServices.Dominio;
using System.ServiceModel.Web;

namespace RESTServices
{
    [ServiceContract]
    public interface IGastos
    {
        [OperationContract]
        [WebInvoke(Method="POST", UriTemplate="Gastos", ResponseFormat=WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        Gasto CrearGasto(Gasto gastoACrear);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Gastos/{codigo}", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        Gasto ObtenerGastos(string codigo);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "AprobarGastos/{codigo}", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        Gasto AprobarGastos(string codigo);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "RechazarGastos/{codigo}", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        Gasto RechazarGastos(string codigo);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "SincronizarGastos", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        void SincronizarGastos();

        [OperationContract]
        [WebInvoke(Method = "PUT", UriTemplate = "Gastos", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        Gasto ModificarGasto(Gasto alumnoAModificar);

        [OperationContract]
        [WebInvoke(Method = "DELETE", UriTemplate = "Gastos", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        void EliminarGasto(string codigo);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Gastos", ResponseFormat = WebMessageFormat.Json)]
        [FaultContract(typeof(DAOException))]
        List<Gasto> ListarGastos();
    }
}
